<%@ page import="com.itheima.pojo.Address" %>
<%@ page import="com.itheima.pojo.User" %><%--
  Created by IntelliJ IDEA.
  User: Yoyo-ba
  Date: 2021/10/31
  Time: 11:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>el表达式获取各种类型数据</title>
</head>
<body>
     <%
       //创建一个Address对象 存到域中
         Address address = new Address();
         address.setArea("昌平区");
         address.setCity("北京");

         request.setAttribute("address",address);

         //创建一个User user
         User user = new User();
         user.setName("jack");
         user.setAge(18);
         user.setAddr(address);

         request.setAttribute("user",user);
     %>
     <%--获取对象 z--%>
   获取 address对象
    ${address}
   <br/>
   获取address中的 city属性${address.city}
   <br/>
   获取user对象 ${user}
   获取user对象中的address中的地区 ${user.addr.area}
</body>
</html>
